package com.shf.film.common;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class SearchCondition implements BaseCondition{
	
	private Map<String,Object> condition = new HashMap<String,Object>();

	public Map<String, Object> getCondition() {
		return condition;
	}

	public void setCondition(Map<String, Object> condition) {
		this.condition = condition;
	}

	@Override
	public String parseCondtion() {
		StringBuffer condtion = new StringBuffer(" ");
		for(String key : condition.keySet()){
			condtion.append(key);
			Object value = this.condition.get(key);
			if(value instanceof ArrayList){
				System.out.println("list");
			}else if(value instanceof Object[]){
				System.out.println("array");
			}else if(value instanceof Integer){
				System.out.println("integer");
			}else if(value instanceof String){
				condtion.append("='").append(value).append("' and ");
			}else if(value instanceof Boolean){
				System.out.println("Boolean");
			}
			System.out.println(key + "	"+this.condition.get(key));
		}
		return null;
	}
}
